<template>
    <div class="contianer">

        <div class="baseMess">
            <div class="userMess">
                <div class="userHeadImg">
                    <el-avatar shape="square" :size="130" :src="userMess.avatar ? userMess.avatar : circleUrl"></el-avatar>

                </div>
                <div class="mess">
                    <span>{{ userMess.nickName }}</span><br>
                    <span>姓名:{{ userMess.userName }}</span><br>
                    <span>性别:{{ userMess.sex == 0 ? '男' : '女' }}</span><br>
                    <span>邮箱:{{ userMess.email }}</span><br>
                </div>

            </div>

            <div class="menu">
                <el-tabs v-model="activeName" @tab-click="handleClick">
                    <el-tab-pane label="基本信息" name="first">
                        <div class="menuLeft">
                            <el-upload class="avatar-uploader" action="api/util/uploadImg" name="imgFile"
                                :show-file-list="false" disabled="">
                                <img v-if="userMess.avatar" :src="userMess.avatar" class="avatar">
                                <i  class="el-icon-plus avatar-uploader-icon"></i>
                            </el-upload>
                        </div>
                        <div class="menuRigth">
                            <el-form :model="userMess" ref="userMess" label-width="100px"
                                size="mini" class="demo-ruleForm">
                                <el-form-item label="姓名：" size="mini">
                                    <span  class="menuUserName">{{ userMess.userName }}</span>
                                </el-form-item>
                                <el-form-item label="昵称：" prop="name">
                                    <span >{{ userMess.nickName }}</span>

                                </el-form-item>

                                <el-form-item label="性别：" prop="resource">
                                    <span>
                                        <span v-if="userMess.sex == 0">男</span>
                                        <span v-if="userMess.sex == 1">女</span>
                                    </span>

                                </el-form-item>
                                <el-form-item label="邮箱：">
                                    <span >{{ userMess.email }}</span>
                                </el-form-item>
                            </el-form>
                        </div>

                    </el-tab-pane>
                    <el-tab-pane label="点赞文章" name="second">配置管理</el-tab-pane>
                    <el-tab-pane label="收藏文章" name="third">角色管理</el-tab-pane>
                    <el-tab-pane label="最近浏览" name="fourth">定时任务补偿</el-tab-pane>
                </el-tabs>
            </div>

        </div>
    </div>
</template>
<script>
export default {
    props: {
        setWidth: {
            type: Number,
            default: 400
        },
        setHeight: {
            type: Number,
            default: 400
        }
    },
    data() {
        return {
            activeName: 'first',
            circleUrl: "https://cube.elemecdn.com/9/c2/f0ee8a3c7c9638a54940382568c9dpng.png",
            userMess: {},

        }
    },
    created() {
        this.init();
    },
    methods: {
        
        init() {
            var id = sessionStorage.getItem("lookUserMessById");
            this.$axios.get("api/wqunAccountController/findAccountPublicById?uid="+id).then((res) =>{
                this.userMess = res.data.data.findAccountPublicById
            })

        },
        handleClick(tab, event) {
            // console.log(tab, event);
        },
    }
}
</script>

<style scoped>
* {
    font-family: "Hiragino Sans GB"
}

* {
    margin: 0;
    padding: 0;
}





.demo-ruleForm {
    width: 500px;
}


.menuUserName {
    width: 40%;
    margin-right: 30px;
    display: inline-block;
}

.menuRigth el-input {
    display: inline;
}

.menuLeft {
    float: left;
}

.menuRigth {
    margin: 10px;
    margin-left: 30px;
    float: left;
}

.avatar {
    height: 200px;

}

.avatar-uploader {
    height: 200px;
    width: 200px;

}

.avatar-uploader .el-upload {
    border: 1px dashed #d9d9d9;
    border-radius: 6px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.avatar-uploader .el-upload:hover {
    border-color: #409EFF;
}

.avatar-uploader-icon {
    font-size: 28px;
    color: #8c939d;
    width: 178px;
    height: 178px;
    line-height: 178px;
    text-align: center;
}



.userHeadImg {
    position: relative;
    top: 40px;
    left: 40px;
}

.mess {
    position: relative;
    top: -90px;
    left: 200px;
    width: 700px;
    height: 130px;
}

.mess span {
    margin-top: 240px;
    color: #676565;

}

.mess span:first-child {
    font-size: 30px;
    color: #676565;

}



.menu {
    padding: 20px
}

.userMess {
    height: 200px;
}

.contianer {}

.baseMess {
    border: solid 1px #cccccc;
    width: 1000px;
    height: 600px;
    margin: 0 auto;
    border-radius: 20px
}
</style>